package org.example;

import org.apache.ibatis.session.SqlSession;
import org.example.mapper.UserMapper;
import org.example.model.User;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    public static void main(String[] args) {
        try (SqlSession session = MyBatisUtil.getSession()) {
            UserMapper userMapper = session.getMapper(UserMapper.class);
            User user = userMapper.selectUserWithProfile(1);
            System.out.println(user);

            LocalDateTime now = LocalDateTime.now();
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
            String formattedNow = now.format(formatter);
            System.out.println("Current time: " + formattedNow);
        }
    }
}
